package com.gr.dmbackend.service.Impl.dormaddmin;

import com.alibaba.fastjson.JSONObject;
import com.gr.dmbackend.mapper.DormaddminMapper;
import com.gr.dmbackend.model.Dormaddmin;
import com.gr.dmbackend.service.dormaddmin.GetDormAddminListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class GetDormAddminListServiceImpl implements GetDormAddminListService {

    @Autowired
    private DormaddminMapper dormaddminMapper;

    @Override
    public JSONObject getDormAddminList() {

        JSONObject resp = new JSONObject();

        List<Dormaddmin> list = dormaddminMapper.selectList(null);

        resp.put("error_message", "success");
        resp.put("dormaddmins", list);

        return resp;
    }
}
